package com.mop.dinnerbook.bean;

// Generated 2009-12-2 17:48:05 by Hibernate Tools 3.2.4.GA

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

/**
 * 项目组成员类
 */
public class Member implements java.io.Serializable,Comparable {

	private Integer mid;//成员ID
	private Project project;//成员所属项目组
        private Department department;//成员所属子项目组
	private String mname;//成员名称
	private String remark;//成员备注信息
	private Integer checked;//成员当天是否订餐
        private Integer valid;//成员是否有效
        private Date rdate;//成员的订餐时间
        private String actionIp;//成员的操作IP
        private Floor floor;//成员所属楼层
	public Integer isChecked() {
		return checked;
	}

	public void setChecked(Integer checked) {
		this.checked = checked;
	}

	private Set<Record> records = new HashSet<Record>(0);
	private Set<Action> actions = new HashSet<Action>(0);

	public Member() {
	}

	public Member(Project project, String mname, String remark,
			Set<Record> records, Set<Action> actions) {
		this.project = project;
		this.mname = mname;
		this.remark = remark;
		this.records = records;
		this.actions = actions;
	}

	public Integer getMid() {
		return this.mid;
	}

	public void setMid(Integer mid) {
		this.mid = mid;
	}

	public Project getProject() {
		return this.project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	public String getMname() {
		return this.mname;
	}

	public void setMname(String mname) {
		this.mname = mname;
	}

	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Set<Record> getRecords() {
		return this.records;
	}

	public void setRecords(Set<Record> records) {
		this.records = records;
	}

	public Set<Action> getActions() {
		return this.actions;
	}

	public void setActions(Set<Action> actions) {
		this.actions = actions;
	}

    public Integer getValid() {
        return valid;
    }

    public void setValid(Integer valid) {
        this.valid = valid;
    }

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    public int compareTo(Object o) {
        if(!(o instanceof Member)){
            throw new RuntimeException();
        }
        Member other = (Member)o;
        if(other.department.getDid() != this.department.getDid()){
            return this.department.getDid() - other.department.getDid();
        }
        return mid.compareTo(other.getMid());
    }

    public Date getRdate() {
        return rdate;
    }

    public void setRdate(Date rdate) {
        this.rdate = rdate;
    }

    public String getActionIp() {
        return actionIp;
    }

    public void setActionIp(String actionIp) {
        this.actionIp = actionIp;
    }

    public Floor getFloor() {
        return floor;
    }

    public void setFloor(Floor floor) {
        this.floor = floor;
    }

}
